package com.twu.biblioteca;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: twer
 * Date: 5/15/13
 * Time: 4:55 PM
 * To change this template use File | Settings | File Templates.
 */
public class BibliotecaModel {

    private static ArrayList<Book> books = new ArrayList<Book>();
    private static ArrayList<Movie> movies = new ArrayList<Movie>();
    private static ArrayList<User> users = new ArrayList<User>();

    static {
        initBooks();
        initMovies();
        initUsers();
    }

    private static void initBooks() {
        books.add(new Book(1, "Continuous Delivery"));
        books.add(new Book(2, "Clean Code"));
        books.add(new Book(3, "Agile"));
    }

    public static ArrayList<Book> getBooks() {
        return books;
    }

    private static void initMovies() {
        movies.add(new Movie("Movie1", 1997, "director1", 1));
        movies.add(new Movie("Movie2", 1998, "director2"));
        movies.add(new Movie("Movie3", 1999, "director3", 3));
        movies.add(new Movie("Movie4", 2000, "director4"));
        movies.add(new Movie("Movie5", 2001, "director5", 2));
        movies.add(new Movie("Movie6", 2002, "director6", 8));
        movies.add(new Movie("Movie7", 2003, "director7"));
        movies.add(new Movie("Movie8", 2004, "director8", 5));
        movies.add(new Movie("Movie9", 2005, "director9", 10));
        movies.add(new Movie("Movie10", 2006, "director10"));
        movies.add(new Movie("Movie11", 2007, "director11", 4));
        movies.add(new Movie("Movie12", 2008, "director12", 6));
        movies.add(new Movie("Movie13", 2009, "director13", 7));
        movies.add(new Movie("Movie14", 2010, "director14", 9));
        movies.add(new Movie("Movie15", 2011, "director15"));
    }

    public static ArrayList<Movie> getMovies() {
        return movies;
    }

    private static void initUsers() {
        users.add(new User("user1", "123", "test1@gmail.com", "123456"));
        users.add(new User("user2", "456", "test2@gmail.com", "123456"));
        users.add(new User("user3", "789", "test3@gmail.com", "123456"));
        users.add(new User("user4", "000", "test4@gmail.com", "123456"));
        users.add(new User("user5", "111", "test5@gmail.com", "123456"));
    }

    public static ArrayList<User> getUsers() {
        return users;
    }
}
